﻿module Sustainalytics.Events.Admin {

    import Common = Sustainalytics.Common;
    import CommonAdmin = Sustainalytics.Common.Admin;

    export class EventsStatusesService implements IEventsStatusesService {

        private items: EventStatus[];
        private $q: ng.IQService;
        public statuses = {
            Draft: 1,
            Published:2
        };

        constructor($q: ng.IQService) {
            this.$q = $q;

            // create items
            this.items =
            [
                { id: 1, name: 'Draft' },
                { id: 2, name: 'Published'},
            ];
        }
        // get events types
        public getEventsStatuses(): ng.IPromise<EventStatus[]> {
            var def: ng.IDeferred<EventType[]> = this.$q.defer();
            def.resolve(this.items);
            return def.promise;
        }
    }


    // register service with Events Angular module
    var mod = angular.module(eventsAdminModuleName);
    
    mod.service('EventsStatusesService',
        ['$q', EventsStatusesService]);
} 